using UnityEngine;
using UnityEngine.UI;

public class UILoading : MonoBehaviour
{
	[Header("Loading")]
	public GameObject loadingGameObject;

	public Image loadingBackgroundImage;

	public Image loadingBarImage;

	public Text loadingText;

	[Header("Tip")]
	public Text tipsText;

	[Header("Description")]
	public Text modeTitleText;

	public Text modeDescriptionText;

	public void Show()
	{
		loadingGameObject.SetActive(value: true);
	}

	public void Hide()
	{
		loadingGameObject.SetActive(value: false);
	}

	public void SetModeDescription(string modeTitle, string modeDescription)
	{
		modeTitleText.text = LocalizationManager.GetTranslation(modeTitle);
		modeDescriptionText.text = LocalizationManager.GetTranslation(modeDescription);
	}

	public void SetTips(string tips)
	{
		tipsText.text = LocalizationManager.GetTranslation(tips);
	}

	public void SetLoadingImage(Sprite sprite)
	{
		loadingBackgroundImage.sprite = sprite;
	}

	public void UpdateLoading(float percent)
	{
		loadingBarImage.fillAmount = percent;
		loadingText.text = string.Format("{0}... {1:0}%", LocalizationManager.GetTranslation("TXT_LOADING"), percent * 100f);
	}
}
